-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch atomic.Value to atomic.Pointer for spanProcessorStates #3926
Switch atomic.Value to atomic.Pointer for spanProcessorStates #3926
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3926 +/- ##
=====================================
Coverage 81.8% 81.8%
=====================================
Files 170 170
Lines 12911 12911
=====================================
Hits 10563 10563
Misses 2129 2129
Partials 219 219
|
Is there any performance difference? |
There is zero performance difference based on the existing benchmark tests.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with the PR, but TBH I am not sure if it is worth addressing globally.
Personally, I see almost no value. Someone needs to write the code, then others need to review and a maintainer needs to merge 😉
However, for sure it would be OK to use atomic.Pointer
in "new codebase" or during refactoring. Finally, it is very good to know that there are no performance differences.
I agree, there is null value in doing this everywhere. I did it in the tracer as a quick one to start looking at the related issue. But I don't think we should apply the principle in other places. |
This is a first look at switching
atomic.Value
toatomic.Pointer
, so we have better type safety, and supposedly better readability.I'm saying "supposedly" for better readability because for this specific case, it requires doing a lot of going from pointer to value, as a slice type can't be used from its pointer.
See #3918.